package com.heima.aliyun.green;

import com.heima.aliyun.green.config.ImageGreenScan;
import com.heima.aliyun.green.config.TextGreenScan;

import java.util.List;
import java.util.Map;

public class AliyunGreenTemplate {

    private ImageGreenScan imageGreenScan;
    private TextGreenScan textGreenScan;

    public AliyunGreenTemplate(ImageGreenScan imageGreenScan, TextGreenScan textGreenScan) {
        this.imageGreenScan = imageGreenScan;
        this.textGreenScan = textGreenScan;
    }

    /***
     * 文本检测
     */
    public Map<String,String> textGreenScan(String content) throws Exception {
        //TextGreenScan
        return textGreenScan.textGreenScan(content);
    }

    /***
     * 图片检测
     */
    public Map<String,String> imageGreenScanForStream(List<byte[]> imageList){
        //ImageGreenScan
        return imageGreenScan.imageGreenScanForStream(imageList);
    }


    /***
     * 图片检测
     */
    public Map<String,String> imageGreenScanForUrl(List<String> imageList){
        //ImageGreenScan
        return imageGreenScan.imageGreenScanForUrl(imageList);
    }

}
